<?php
	Yii::app()->clientscript
		// use it when you need it!
		
		->registerCssFile( Yii::app()->request->baseUrl . '/css/bootstrap.css' )
		->registerCssFile( Yii::app()->request->baseUrl . '/css/bootstrap-responsive.css' )
		->registerCoreScript( 'jquery' )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-transition.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-alert.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-modal.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-dropdown.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-scrollspy.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-tab.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-tooltip.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-popover.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-button.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-collapse.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-carousel.js', CClientScript::POS_END )
		->registerScriptFile( Yii::app()->request->baseUrl . '/js/bootstrap-typeahead.js', CClientScript::POS_END )
		
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="shortcut icon" href="<?php echo Yii::app()->request->baseUrl; ?>/css/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
<meta name="language" content="en" />

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" />



</head>
<?php require_once 'Mobile_Detect.php';
	
	

			$detect = new Mobile_Detect;
			
if ($detect->isMobile() ){ ?>
<center>
<h2><img src ="./css/d5jlogo.png" style="width:90px;">D5J Entry Monitoring System</h2>
</center>
<div id="navigation"> 

	<a class="btn btn-navbar"  data-toggle="collapse" data-target=".nav-collapse">
					Menu
				</a> 
				
				<?php $this->widget('zii.widgets.CMenu',array(
						'htmlOptions' => array( 'class' => 'nav-collapse collapse' ),
						'activeCssClass'	=> 'active',
						'items'=>array(
							array('label'=>'Home', 'url'=>array('/site/index')),
				//array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
				//array('label'=>'Contact', 'url'=>array('/site/contact')),
				array('label'=>'Entry', 'url'=>array('/entry/admin'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Container', 'url'=>array('/container'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Items', 'url'=>array('/items'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Clients', 'url'=>array('/client'),'visible'=>!Yii::app()->user->isGuest),
				//array('label'=>'Employee Task', 'url'=>array('/employeeTask')),
				array('label'=>'Port', 'url'=>array('/port'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Shipping Line', 'url'=>array('/shippingLine'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Employees', 'url'=>array('/employee'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Entry Log', 'url'=>array('/entryLog'),'visible'=>!Yii::app()->user->isGuest),
				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
			),
					)); ?>
				<!--<ul class="nav-collapse collapse">
				<li>ok</li>
				</ul>
				-->
				
        <a title="Navigate" id="navigate" class="button normal"> 
          <span class="before"></span> 
        
          <span class="after"></span> 
        </a> 
        
      </div> 
      <!-- END NAVIGATION & SEARCH --> 
 
					
					
					
					
					<?php
 
} 
 
 else
 {?>
 
<body>
	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container-fluid">
			
			
				<img style="float:left; max-width:40px; " src="<?php echo Yii::app()->request->baseUrl; ?>/css/logo.png">
				<a class="brand" href="./"><?php echo Yii::app()->name ?></a>
				
				
           
				<?php $this->widget('zii.widgets.CMenu', array(
                'items' => array(
				
				
                    array(
                        'label' => '<i class="icon-list-alt"></i><span class="username">Entries</span> <i class="icon-angle-down"></i>',
                        'url' => '#',
						'visible'=>!Yii::app()->user->isGuest,
                        'linkOptions'=> array(
                            'class' => 'dropdown-toggle',
                            'data-toggle' => 'dropdown',
                            ),
                        'itemOptions' => array('class'=>'dropdown user'),
                        'items' => array(
						
							array(
                                'label' => '<i class="icon-th"></i> View All Entries</a>',
                                'url' => array('/entry/admin'),
                            ),
                            array(
                                'label' => '<i class="icon-plus"></i> Add New Entry',
                                'url' => array('/entry/create')
                            ),
							  array(
                                'label' => '<i class="icon-list"></i> Generate Monthly Report',
                                'url' => array('/entry/searchM')
                            ),
                            
                            array(
                              'label' => '',
                                array(
                                    'class' => 'divider',
                                )
                            ),
                            array(
                                'label' => '<i class="icon-list"></i> List of Containers',
                                'url' => array('/container'),
                            ),
							array(
                                'label' => '<i class="icon-list"></i> List of Items',
                                'url' => array('/items'),
                            ),
							 array(
                              'label' => '',
                                array(
                                    'class' => 'divider',
                                )
                            ),
                            array(
                                'label' => '<i class="icon-pencil"></i> Entry Logs',
                                'url' => array('/entryLog'),
                            ),
                        )
                    ),
					array(
                        'label' => '<i class="icon-user"></i><span class="username">Clients</span> <i class="icon-angle-down"></i>',
                        'url' => '#',
						'visible'=>!Yii::app()->user->isGuest,
                        'linkOptions'=> array(
                            'class' => 'dropdown-toggle',
                            'data-toggle' => 'dropdown',
                            ),
                        'itemOptions' => array('class'=>'dropdown user'),
                        'items' => array(
							array(
                                'label' => '<i class="icon-th"></i> List of Clients</a>',
                                'url' => array('/client'),
                            ),
                            array(
                                'label' => '<i class="icon-plus"></i> Add New Client',
                                'url' => array('/client/create')
                            ),
                            
                           
                        )
                    ),
					array(
                        'label' => '<i class="icon-flag"></i><span class="username">Ports</span> <i class="icon-angle-down"></i>',
                        'url' => '#',
						'visible'=>!Yii::app()->user->isGuest,
                        'linkOptions'=> array(
                            'class' => 'dropdown-toggle',
                            'data-toggle' => 'dropdown',
                            ),
                        'itemOptions' => array('class'=>'dropdown user'),
                        'items' => array(
							array(
                                'label' => '<i class="icon-th"></i> List of Ports</a>',
                                'url' => array('/port'),
                            ),
                            array(
                                'label' => '<i class="icon-plus"></i> Add a new Port',
                                'url' => array('/port/create')
                            ),
                           
                           
                        )
                    ),
					array(
                        'label' => '<i class="icon-plane"></i><span class="username">Shipping Line</span> <i class="icon-angle-down"></i>',
                        'url' => '#',
						'visible'=>!Yii::app()->user->isGuest,
                        'linkOptions'=> array(
                            'class' => 'dropdown-toggle',
                            'data-toggle' => 'dropdown',
                            ),
                        'itemOptions' => array('class'=>'dropdown user'),
                        'items' => array(
							array(
                                'label' => '<i class="icon-th"></i> List of Shipping Lines</a>',
                                'url' => array('/shippingLine'),
                            ),
                            array(
                                'label' => '<i class="icon-plus"></i> Add a new Shipping Line',
                                'url' => array('/shippingLine/create')
                            ),
                           
                           
                        )
                    ),
					array(
                        'label' => '<i class="icon-eye-open"></i><span class="username">Employees</span> <i class="icon-angle-down"></i>',
                        'url' => '#',
						'visible'=>!Yii::app()->user->isGuest,
                        'linkOptions'=> array(
                            'class' => 'dropdown-toggle',
                            'data-toggle' => 'dropdown',
                            ),
                        'itemOptions' => array('class'=>'dropdown user'),
                        'items' => array(
							array(
                                'label' => '<i class="icon-star"></i> Manage Employees</a>',
                                'url' => array('/employee'),
                            ),
                            
                           
                        )
                    ),
					array(
                        'label' => '<i class="icon-eye-open"></i><span class="username">Search</span> <i class="icon-angle-down"></i>',
                        'url' => '#',
						'visible'=>!Yii::app()->user->isGuest,
                        'linkOptions'=> array(
                            'class' => 'dropdown-toggle',
                            'data-toggle' => 'dropdown',
                            ),
                        'itemOptions' => array('class'=>'dropdown user'),
                        'items' => array(
							array(
                                'label' => '<i class="icon-search"></i> Search Items</a>',
                                'url' => array('items/admin'),
                            ),
                            array(
                                'label' => '<i class="icon-search"></i> Search Container Number</a>',
                                'url' => array('container/admin'),
                            ),
                            
                           
                        )
                    ),
			
					
					
				//	array('label'=>'Container', 'url'=>array('/container'),'visible'=>!Yii::app()->user->isGuest),
				//array('label'=>'Items', 'url'=>array('/items'),'visible'=>!Yii::app()->user->isGuest),
				//array('label'=>'Clients', 'url'=>array('/client'),'visible'=>!Yii::app()->user->isGuest),
				
				//array('label'=>'Port', 'url'=>array('/port'),'visible'=>!Yii::app()->user->isGuest),
			//	array('label'=>'Shipping Line', 'url'=>array('/shippingLine'),'visible'=>!Yii::app()->user->isGuest),
				//array('label'=>'Employees', 'url'=>array('/employee'),'visible'=>!Yii::app()->user->isGuest),
				//array('label'=>'Entry Log', 'url'=>array('/entryLog'),'visible'=>!Yii::app()->user->isGuest),
					array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
					array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
					
                ),
                'encodeLabel' => false,
                'htmlOptions' => array(
                    'class'=>'nav',
                        ),
                'submenuHtmlOptions' => array(
                    'class' => 'dropdown-menu',
                )
            ));?>
				
				
					
				
			</div>
		</div>
	</div>
	
 <?php } ?>
 


	
	
	
	
	
	
	
	
	
	<?php require_once 'Mobile_Detect.php';
	
	

			$detect = new Mobile_Detect;
			
if ($detect->isMobile() ){

?>

<?php if(isset($this->breadcrumbs)):?>
			<?php $this->widget('zii.widgets.CBreadcrumbs', array(
				'links'=>$this->breadcrumbs,
				'homeLink'=>false,
				'tagName'=>'ul',
				'separator'=>'',
				'activeLinkTemplate'=>'<li><a href="{url}">{label}</a> <span class="divider">/</span></li>',
				'inactiveLinkTemplate'=>'<li><span>{label}</span></li>',
				'htmlOptions'=>array ('class'=>'breadcrumb')
			)); ?>
		<!-- breadcrumbs -->
	  <?php endif?>
	
	<?php echo $content ?>
 <div  style="background-color:white; padding:10px">
 <h4>About</h4>
				<ul>
					<li><a href="?r=site/page&view=about">The Company</a></li>
					<li><a href="http://projects2.apc.edu.ph/wiki/index.php/CSPROJ2_MI121_Group_5:_Team_Leader:_Guinto%2C_Carl_Justin_-_BSIT-MI">Documentation</a></li>
					
				</ul>
			
				<h4><a href="?r=site/contact">Contact Us</a></h4>
			</div>
<div   id="footer" style="background-color:white; padding:10px"> 
      <span class="copyright">&copy; <?php echo Yii::app()->name ?> <?php echo date('Y') ?></span> 
<a href="http://apc.edu.ph">Asia Pacific College</a><br />
		&copy; CSPROJ2 MI121 Group 5: Guinto, Casipit, & Flores E.<br/>
		All Rights Reserved. <?php echo date('Y'); ?> <br/>
		<?php echo Yii::powered(); ?>
    </div> 
	
	
 <?php
 } 
 
 else
 {?>
 
 
 <div class="cont">
	<div class="container-fluid">
	  <?php if(isset($this->breadcrumbs)):?>
			<?php $this->widget('zii.widgets.CBreadcrumbs', array(
				'links'=>$this->breadcrumbs,
				'homeLink'=>false,
				'tagName'=>'ul',
				'separator'=>'',
				'activeLinkTemplate'=>'<li><a href="{url}">{label}</a> <span class="divider">/</span></li>',
				'inactiveLinkTemplate'=>'<li><span>{label}</span></li>',
				'htmlOptions'=>array ('class'=>'breadcrumb')
			)); ?>
		<!-- breadcrumbs -->
	  <?php endif?>
	
	<?php echo $content ?>
	
	
	</div><!--/.fluid-container-->
	</div>
	

	
	<div  class="footer">
	  <div class="container">
		<div class="row">
			
			<div id="footer-terms" class="col-md-6">
				<a href="http://apc.edu.ph">Asia Pacific College</a><br />
		&copy; CSPROJ2 MI121 Group 5: Guinto, Casipit, & Flores E.<br/>
		All Rights Reserved. <?php echo date('Y'); ?> <br/>
		<?php echo Yii::powered(); ?>
			</div> <!-- /.span6 -->
		 </div> <!-- /row -->
	  </div> <!-- /container -->
	</div>
</body>
</html>

 

	
 <?php } ?>
	

